<template>
	<view class="contina">
		<view class="w" v-if="true">
			<view class="tip">
				以下为已开通信息化管理系统服务的企业，您可提前续费服务
			</view>
			<template v-for="(item,idx) in list">
				<view class="card flex_a_c">
					<view class="lf" @click="toPath(item.id)">
						<view class="flex_a_c">
							<view class="row"></view>
							<view class="name">{{item.name}}</view>
						</view>
						<view class="time">服务期限：{{item.duration_start}}-{{item.duration_end}}</view>
					</view>
					<view class="btn" @click="xf(item.id)">续费</view>
				</view>
			</template>
		</view>
		<view class="no" v-else>
			<image style="width: 206px;height: 142px;" src="../../static/image/none.png"></image>
			<view class="em">暂无企业</view>
		</view>
		<flooterCom text="创建新企业" @click="toAdd"></flooterCom>
	</view>
</template>

<script>
	import searchCom from "@/compoment/searchCom.vue";
	import flooterCom from "@/compoment/flooterCom.vue"
	export default {
		data() {
			return {
				list: [],
				page: 1,
			}
		},
		components: {
			searchCom,
			flooterCom
		},
		onShow() {
			this.getList()
		},
		onHide() {
			this.page = 1
			this.list = []
		},
		methods: {
			toAdd() {
				uni.navigateTo({
					url: "/pagesB/creatEntity/creatEntity"
				})
			},
			toPath(id) {
				uni.navigateTo({
					url: "/pagesB/EntetiyInfo/EntetiyInfo?id="+id
				})
			},
			async getList() {
				let res = await this.$api.corpApi.list({
					page: this.page,
				})
				if (res.list.length) {
					this.list = this.list.concat(res.list)
					this.page++
				}
			},
			xf(id) {
				uni.navigateTo({
					url: "/pagesB/payService/payService?id="+id
				})
			}
		}
	}
</script>

<style lang="scss">
	.contina {
		background-color: #F8F8F8;
		height: 100%;

		.tip {
			font-size: 24rpx;
			font-weight: 400;
			color: #000000;
			margin: 30rpx 0;
		}

		.card {
			justify-content: space-between;

			.lf {
				width: 100%;
				.time {
					font-size: 24rpx;
					font-weight: 400;
					color: #888888;
					margin-top: 20rpx;
				}

				.row {
					width: 6rpx;
					height: 30rpx;
					background: #0074FF;
				}

				.name {
					font-size: 28rpx;
					font-weight: 400;
					color: #000000;
					margin-left: 12rpx;
				}
			}

			.btn {
				width: 110rpx;
				height: 46rpx;
				background: #0074FF;
				border-radius: 50px 50px 50px 50px;
				font-size: 26rpx;
				font-weight: 400;
				color: #FFFFFF;
				line-height: 46rpx;
				text-align: center;
			}
		}

		.no {
			margin-top: 50rpx;
			display: flex;
			font-size: 28rpx;
			justify-content: center;
			flex-direction: column;
			align-items: center;
			margin-top: 332rpx;

			.em {
				width: 128rpx;
				height: 50rpx;
				font-size: 32rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				color: #888888;
			}
		}
	}
</style>